package com.yzh.oop3;

import java.util.Arrays;

/**
 * @author 于振晗
 * @title: Computer
 * @description: TODO 电脑
 * @date 2020年08月24日
 * @path com.yzh.oop3
 */
public class Computer {
    //CPU
    String cpu;
    //主板
    String mainBoard;
    //键盘
    String keyBoard;

    public Computer() {
        super();
    }
    public Computer(String cpu,String mainBoard,String keyBoard) {
        this.cpu = cpu;
        this.mainBoard = mainBoard;
        this.keyBoard = keyBoard;
    }

    @Override
    public String toString() {
        return "Computer{" +
                "cpu='" + cpu + '\'' +
                ", mainBoard='" + mainBoard + '\'' +
                ", keyBoard='" + keyBoard + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Computer computer1 = new Computer();
        computer1.cpu = "AMD";
        computer1.mainBoard = "技嘉";
        computer1.keyBoard = "雷柏";
        System.out.println(computer1);

        Computer computer2 = new Computer("Intel","华硕","双飞燕");
        System.out.println(computer2);
        Computer [] computers = {new Computer("AMD","技嘉","雷柏"),new Computer("Intel","华硕","双飞燕")};
        System.out.println(Arrays.toString(computers));
    }
}
